package com.sx.first.biz;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.sx.first.biz.StoragetypeBiz;
import com.sx.first.dao.StoragetypeDAO;
import com.sx.first.model.Storagetype;

@Service("storagetypeBiz")
@Scope("prototype")
public class StoragetypeBiz {
	private StoragetypeDAO storagetypeDAO;
	
	public void setStoragetypeDAO(StoragetypeDAO storagetypeDAO) {
		this.storagetypeDAO = storagetypeDAO;
	}

	public List<Storagetype> findAll(){
		return storagetypeDAO.findAll();
	}

	public void save(Storagetype sto) {
		storagetypeDAO.save(sto);
		
	}

	public Storagetype findById(int stoId) {
		return storagetypeDAO.findById(stoId);
	}

	public void delete(int stoId) {
		storagetypeDAO.delete(storagetypeDAO.findById(stoId));
		
	}

	public void update(Storagetype sto) {
		storagetypeDAO.update(sto);
		
	}
	
}
